{include file="public/header"}
<body>
	<div class="sectionY">
		<a href="javascript:history.back();">
			<img src="__PUBLIC__/home/images/a19.png" alt="" class="a1">
		</a>
		<p class="p1">订单详情</p>
	</div>
	<div class="kong1" style=""></div>
	<div class="dingd_section1">
		<div class="container">
			<div class="dingd_section1_1">
				<p class="p1">{$detail.status_str}</p>
				<p class="p2">{$detail.desc_str}</p>
			</div>
		</div>
	</div>
	<div class="dingd_section2">
		<div class="container">
			<div class="a1">
				<p class="p1">
					<img src="__PUBLIC__/home/images/a71.png" alt="">
					<span class="s1">{$detail.status_str_two}</span>
				</p>
				<p class="p2">{$detail.status_time}</p>
			</div>
			<div class="a1">
				<p class="p1">
					<img src="__PUBLIC__/home/images/a72.png" alt="">
					<span class="s2">{$detail.send_name} {$detail.send_mobile}</span>
				</p>
				<p class="p2">{$detail.send_address}</p>
			</div>
		</div>
	</div>
	<div class="ge"></div>
	<div class="dingd_section3">
		<div class="q_section3">
			<ul class="clearfix">
				{foreach $detail.data as $d}
				<li class="clearfix">
					<div class="big clearfix">
						<div class="logo">
							<a href=""><img src="{$d.img_url}" alt=""></a>
						</div>
						<div class="center">
							<a href="">
								<p class="p1 chao2">{$d.title}-{$d.spec_title}</p>
							</a>
							<p class="p3 clearfix">
								<span class="s1">￥{$d.price}</span>
							</p>
							<p class="p4">x{$d.num}</p>
						</div>
					</div>
				</li>
				{/foreach}
			</ul>
		</div>
	</div>
	<div class="ge"></div>
	<div class="dingd_section4">
		<div class="f1 clearfix">
			<span class="s1">商品金额</span>
			<span class="s2">￥{$detail.goods_price}</span>
		</div>
		<div class="f1 clearfix">
			<span class="s1">运费</span>
			<span class="s3">￥{$detail.dispatch_price}</span>
		</div>
		<div class="f1 clearfix">
			<span class="s1">积分抵扣</span>
			<span class="s2">￥{$detail.score_fee}</span>
		</div>
		<div class="f1 clearfix">
			<span class="s1">应付总额</span>
			<span class="s3">￥{$detail.money}</span>
		</div>
	</div>
	<div class="ge"></div>
	<div class="dingd_section4">
		<div class="f1 clearfix">
			<span class="s1">订单编号</span>
			<span class="s4">{$detail.order_sn}</span>
		</div>
		{if $detail.send_time > 0}
		<div class="f1 clearfix">
			<span class="s1">快递单号</span>
			<span class="s4">{$detail.send_sn}</span>
		</div>
		{/if}
		<div class="f1 clearfix">
			<span class="s1">下单时间</span>
			<span class="s4">{:date("Y/m/d H:i:s", $detail.create_time)}</span>
		</div>
		{if $detail.pay_status eq 1}
		<div class="f1 clearfix">
			<span class="s1">支付时间</span>
			<span class="s4">{$detail.pay_time}</span>
		</div>
		{/if}
	</div>
	<div class="kong"></div>

		{if $detail.order_status eq 0}
	<div class="dingd_foot ulData">
		<a href="javascript:;" data-order_id="{$detail.id}" class="a1 cancelOrder">取消订单</a>
		<a href="javascript:;" data-order_id="{$detail.id}" class="a2 payOrder">去付款</a>
	</div>
		{/if}

		{if $detail.order_status eq 2}

	<div class="dingd_foot ulData">
		<a href="javascript:;" data-order_id="{$detail.id}" class="a2 receiveOrder">确认收获</a>
	</div>
		{/if}

		{if $detail.order_status eq 3}
		<div class="dingd_foot ulData">
			<a href="javascript:;" data-order_id="{$detail.id}" class="a2 goComment">去评价</a>
		</div>
		{/if}
</body>

<script>
	//取消订单
	$(".ulData").on("click", ".cancelOrder", function (e) {
		let order_id = $(this).data("order_id"),o=this;
		modal.confirm("确定取消订单？", "确定", function () {
			$.post("{:url('cancelOrder')}", {order_id:order_id}, function (res) {
				modal.msg(res.result_info);
				if(res.result_code==0){
					$(o).parents(".f1").remove();
				}
			});
		})
	})
	//去支付
	$(".ulData").on("click", ".payOrder", function (e) {
		let order_id = $(this).data("order_id");
		location.href="{:url('payInfo')}?order_id="+order_id;

	})
	//确认收获
	$(".ulData").on("click", ".receiveOrder", function (e) {
		let order_id = $(this).data("order_id");
		modal.confirm("确定收获？", "确定", function () {
			$.post("{:url('receiveOrder')}", {order_id:order_id}, function (res) {
				modal.msg(res.result_info);
				if(res.result_code == 0){
					$(o).parents(".f1").remove();
				}
			});
		})

	})
	//去评价
	$(".ulData").on("click", ".goComment", function (e) {
		let order_id = $(this).data("order_id");
		location.href="{:url('goComment')}?order_id="+order_id;
	})



</script>

</html>